<html>
<head><meta charset="utf-8"><title>none-recursive command aliases · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/none-recursive.20command.20aliases.html">none-recursive command aliases</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="230235048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/none-recursive%20command%20aliases/near/230235048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/none-recursive.20command.20aliases.html#230235048">(Mar 14 2021 at 12:20)</a>:</h4>
<p>I was looking at a <code>.cargo/config</code> and had the idea "hey, instead of polluting a repo with clippy lint allow/warn attributes, why not just define a clippy alias which calls clippy with the corresponding flags"</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[alias]</span>
<span class="n">clippy</span> <span class="o">=</span> <span class="s">"clippy --all-features -- -Dclippy::all"</span>
</code></pre></div>
<p>but as it turns out this will call the alias recursively instead of calling <code>cargo clippy</code>/<code>~/.cargo/bin/cargo-clippy</code></p>
<div class="codehilite"><pre><span></span><code>thread &#39;main&#39; has overflowed its stack
fatal runtime error: stack overflow
[1]    1519424 abort (core dumped)  cargo --color=always clippy
</code></pre></div>
<p>Fixing this by making aliases not call itself would be a breaking change I guess..?</p>



<a name="230258317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/none-recursive%20command%20aliases/near/230258317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/none-recursive.20command.20aliases.html#230258317">(Mar 14 2021 at 18:10)</a>:</h4>
<p>Detecting it seems like a good idea. But in general cargo tries to avoid allowing shadowing via aliases.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>